// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.


import Vue from 'vue'
import App from './App'
import VueWechatTitle from 'vue-wechat-title'
import store from './store'
import vGlobalVariable from '../modules/vGlobalVariable'
import commonPlugins from '../modules/commonPlugins'
import VueLazyload from 'vue-lazyload'
import rem from '../static/js/rem'
import 'url-search-params-polyfill';
import xtoken from './x/xtoken'
import router from './router'
import XCookie from './x/XCookie'
import animated from 'animate.css'
import VueScroller from 'vue-scroller';
import Mint from 'mint-ui';
import'mint-ui/lib/style.css'
import {mapState,mapMutations,mapGetters,mapActions} from 'vuex'

import VueAwesomeSwiper from 'vue-awesome-swiper'
import Vconsole from 'vconsole';

Vue.config.productionTip = false

Vue.prototype.NW_API_TOKEN = "/nw_api"+ "/" + process.env.LOCALE;
Vue.prototype.NW_API_TOKEN1 = "/nw_api"+ "/" + process.env.VERSION;
Vue.prototype.NW_API = "/nw_api";
Vue.prototype.VERSION = process.env.VERSION;
Vue.prototype.LOCALE = process.env.LOCALE;
Vue.prototype.NW_API_API_LOCALE_VERSION = "/nw_api/api/" + process.env.LOCALE + "/" + process.env.VERSION ;
Vue.prototype.NW_API_LOCALE_VERSION = "/api/" + process.env.LOCALE + "/" + process.env.VERSION ;
Vue.prototype.systemImgServer = "https://oss.pg.yibaotong.top/images/";
Vue.prototype.systemFileServer = "https://oss.pg.yibaotong.top/files/";
Vue.prototype.ybtImgServer = "https://oss.yibaotong.top/images/";
Vue.prototype.thumbnailImg = "https://oss.pg.yibaotong.top/thumbnails/"
Vue.prototype.CURRENTSTORE = 'CURRENTSTORE'
Vue.prototype.CURRENTUSER = 'CURRENTUSER'
Vue.prototype.CURRENTTHIRD = 'CURRENTTHIRD'
Vue.prototype.OAUTHTHIRDID = 'OAUTHTHIRDID'
Vue.prototype.OAUTHTHIRDPOOL = 'OAUTHTHIRDPOOL'
Vue.prototype.NEXTPAGE = 'NEXTPAGE'
Vue.prototype.SHAREINFO = 'SHAREINFO'
Vue.prototype.BROWSER = 'BROWSER'//wx share browser info
Vue.prototype.COOKIEUSER = 'COOKIEUSER'//cookie user
Vue.prototype.NOWID = 'NOWID'//项目中各个id
Vue.prototype.imgPath = process.env.FILE_PATH
Vue.prototype.IDENTITYINFO = 'IDENTITYINFO'//身份信息
Vue.prototype.CURRENTBROWSEKEY = 'CURRENTBROWSEKEY'//身份令牌
Vue.prototype.ONLINESTATEBROWSEMAP = 'ONLINESTATEBROWSEMAP'//前在线登录用户在浏览内容的标识
Vue.prototype.CHATAPPKEY = process.env.ONLINE ? '0acabe4c61bb55009c9c11f055e7eb8c' : 'ba3506c42c732dc7c5a52642fab360a1';
Vue.prototype.mapState =mapState;
Vue.prototype.mapActions =mapActions;
Vue.prototype.mapGetters =mapGetters;
Vue.prototype.mapMutations =mapMutations;
var vConsole;
if (XCookie.isOpenVConsole()) {
    vConsole = new Vconsole();
}

export default vConsole;

rem.fontSizeRem();
//swiper
Vue.use(VueAwesomeSwiper);
/*网页标题*/
Vue.use(VueWechatTitle);
//全局方法
Vue.use(commonPlugins);
// Vue.use(Mint)
//全局变量
Vue.use(vGlobalVariable);
Vue.use(animated);
Vue.use(Mint);
Vue.use(VueLazyload, {
    preLoad: 1,// 预加载比例
    error: './assets/images/common/nw_bg.png',
    // loading: './assets/develop/images/bg_transparent.png',
    attempt: 2,
})
/*使用上啦下拉插件*/
Vue.use(VueScroller);

/* eslint-disable no-new */

let timer = setInterval(function () {
    if (xtoken.init()) {
        new Vue({
            el: '#app',
            router,
            store,
            components: {App},
            template: '<App/>'
        })
        clearInterval(timer);
    }
}, 10)

